#ifndef SLIDER_H
#define SLIDER_H

#include <QWidget>
#include <QColor>
#include <QPainter>
class cSlider : public QWidget
{
    Q_OBJECT
public:
    explicit cSlider(QWidget *parent = nullptr);
    int currentIndex;
    QString currentValue;
    QList<QString>listValue;
    QColor foreground;
    QColor background;
    QColor lineColor;
    QColor textColor;
    bool horizontal;
    int percent ;
    int offset ;
    int pressed ;
    int pressedPos ;
    int currentPos ;
    void wheelEvent(QWheelEvent *e);
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *);
    void paintEvent(QPaintEvent *);
    void drawBg(QPainter *painter);
    QPainter painter;
    void drawLine(QPainter *painter);
    void drawText(QPainter *painter, int index, int offset);
    void checkPosition();
    QStringList getListValue() const;
    int getCurrentIndex() const;
    QString getCurrentValue() const;
   bool getHorizontal() const;
   QColor getForeground() const;
   QColor getBackground() const;
   QColor getLineColor() const;
   QColor getTextColor() const;
   QSize sizeHint() const;
   QSize minimumSizeHint() const;
   void setListValue(const QStringList &listValue);
   void setCurrentIndex(int currentIndex);
   void setCurrentValue(const QString &currentValue);
   void setHorizontal(bool horizontal);
   void setForeground(const QColor &foreground);
   void setBackground(const QColor &background);
   void setLineColor(const QColor &lineColor);
   void setTextColor(const QColor &textColor);


signals:
   void currentIndexChanged(int currentIndex);
   void currentValueChanged(QString currentValue);

};

#endif // SLIDER_H
